<?php 
session_start();
$username=$_SESSION['valid_user'];
$authlevel=$_SESSION['authlevel'];
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="taglib.css">
</head>
<body>
<div id="upperbar">
<span id="leftheader">search, etc</span>
<span id="userselector">
<?php 
if (strlen($username)>0) {
	echo "Logged in as: ".$username;
	echo "<a href=\"logout.php\">[logout]</a>";
} else {
	echo "<form method=\"POST\" name=\"loginform\" action=\"login.php\"> 
		Username: <input type=\"text\" name=\"username\">  
		<a href=\"javascript:document.loginform.submit();\">[login]</a></form>";
}
?>
</span>
</div>